/*
 * @Author: huangyingli
 * @Date: 2023-02-22 19:26:34
 * @LastEditors: huangyingli
 * @LastEditTime: 2023-02-22 19:48:16
 * @Description: 
 */
import { Menu } from 'antd';
import { useNavigate } from 'react-router-dom';

function getItem(label, key, icon, children, type) {
  return {
    key,
    icon,
    children,
    label,
    type,
  };
}

export default function CmsMenu() {
  const navigate = useNavigate();
  const items = [
    getItem('组件管理', 'component-manage'),
    getItem('模板管理', 'modal-manage'),
    getItem('栏目管理', 'column-manage'),
    getItem('内容管理', 'content-manage'),
    getItem('系统管理', 'sub4', '', [
      getItem('用户管理', '9'),
      getItem('角色管理', '10'),
      getItem('菜单管理', '11'),
    ]),
  ];

  function onClick(item) {
    console.log('item', item)
    navigate(item.keyPath.join('/'))
  }
  return (
    <Menu
      onClick={onClick}
      // style={{
      //   width: 250,
      // }}
      mode="inline"
      items={items}
    ></Menu>
  );
}
